package com.ruoyi.common.enums;


public enum ServiceCodeEnum {
    IESI123101("IESI123101", "商户申请代付限额"),
    IESI123102("IESI123102", "商户限额申请记录查询"),
    IESI123103("IESI123103", "商户代付申请"),
    IESI123104("IESI123104", "商户代付申请记录查询"),
    IESI123105("IESI123105", "商户代付结算账号余额查询"),
    IESI123106("IESI123106", "商户代付结算账号明细查询"),
    IESI123107("IESI123107", "商户对账文件下载"),
    IESI123108("IESI123108", "商户限额退款"),
    IESI123109("IESI123109", "商户代付电子回单下载");

    private ServiceCodeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    private String code;
    private String desc;

    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getDesc() {
        return desc;
    }
    public void setDesc(String desc) {
        this.desc = desc;
    }
    public static ServiceCodeEnum getByCode(String code) {
        if(code == null) {
            return null;
        }
        code = code.trim();
        if(code.equals("")) {
            return null;
        }
        for(ServiceCodeEnum item : ServiceCodeEnum.values()) {
            if(item.getCode().equals(code)) {
                return item;
            }
        }
        return null;
    }
    /**
     * 判断是否相等
     *
     * @param code
     * @return
     */
    public boolean equalEnum(String code) {
        if (code == null) {
            return false;
        }
        return this.code.equals(code);
    }
}
